home *** CD-ROM | disk | FTP | other *** search
/ Developer CD Series 1996 April: Mac OS SDK / Dev.CD Apr 96 SDK / Dev.CD Apr 96 SDK1.toast / Development Kits (Disc 1) / OpenDoc / Sample Code / PartMaker 4.4 / PartMaker Documents / SamplePart (C)• / SamplePart (C)•.rsrc / dFRK_5016 < prev    next >
Encoding:
Text File  |  1995-12-14  |  11.9 KB  |  519 lines

  1. /*
  2.     File:        SamplePart.r
  3.  
  4.     Contains:    SamplePartC Resources
  5.  
  6.     Written by:    Steve Smith
  7.  
  8.     Copyright:    © 1994-95 by Apple Computer, Inc., all rights reserved.
  9. */
  10.  
  11. #define SystemSevenOrBetter 1            // we want the extended types
  12. #define    SystemSevenOrLater    1            // Types.r uses this variable
  13.  
  14. // -- MPW Rez Includes --
  15.  
  16. #include "Types.r"
  17. #include "SysTypes.r"
  18. #include "CodeFragmentTypes.r"
  19.  
  20. // -- OpenDoc Includes --
  21.  
  22. #ifndef __ODTYPES_R__
  23. #include "ODTypes.r"
  24. #endif
  25.  
  26. #ifndef SOM_Module_OpenDoc_StdDefs_defined
  27. #include "StdDefs.r"
  28. #endif
  29.  
  30. // -- SamplePart Includes --
  31.  
  32. #ifndef _SAMPLEPARTDEF_
  33. #include "SamplePartDef.h"
  34. #endif
  35.  
  36. #ifndef _SAMPLEPARTVERS_
  37. #include "SamplePartVers.h"
  38. #endif
  39.  
  40. //-------------------------------------------------------------------------------------
  41. // .rsrc resources
  42. //-------------------------------------------------------------------------------------
  43.  
  44. // SamplePart - This gets the resources from my .rsrc file (PICTs etc.)
  45. include "SamplePartOtherResources.rsrc";
  46.  
  47. //-------------------------------------------------------------------------------------
  48. // Finder Version Resources
  49. //-------------------------------------------------------------------------------------
  50.  
  51. // Part's Finder Version Resource
  52.  
  53. resource 'vers' (1) {
  54.     currentMajorVersion,
  55.     finderMinorVersion,
  56.     developmentStage,
  57.     preReleaseNumber,
  58.     verUS,
  59.     shortVersionStr,
  60.     shortVersionStr", © Apple Computer, Inc. 1994-1995"
  61. };
  62.  
  63. resource 'vers' (2) {
  64.     currentMajorVersion,
  65.     finderMinorVersion,
  66.     developmentStage,
  67.     preReleaseNumber,
  68.     verUS,
  69.     shortVersionStr,
  70.     "OpenDoc™ Sample Code"
  71. };
  72.  
  73. //-------------------------------------------------------------------------------------
  74. // Code Fragment Resources
  75. //-------------------------------------------------------------------------------------
  76.  
  77. resource 'cfrg' (0) {
  78.     {    /* [1] */
  79. #ifdef _68KBUILD_
  80.         kMotorola,
  81. #else
  82.         kPowerPC,
  83. #endif
  84.         kFullLib,
  85.         currentVersion,
  86.         compatibleVersion,
  87.         kDefaultStackSize,
  88.         kNoAppSubFolder,
  89.         kIsLib,
  90.         kOnDiskFlat,
  91.         kZeroOffset,
  92.         kWholeFork,
  93.         kSamplePartID,        /* This must be the class ID. */
  94.         /* [2] */
  95. #ifdef _68KBUILD_
  96.         kMotorola,
  97. #else
  98.         kPowerPC,
  99. #endif
  100.         kFullLib,
  101.         currentVersion,
  102.         compatibleVersion,
  103.         kDefaultStackSize,
  104.         kNoAppSubFolder,
  105.         kIsLib,
  106.         kOnDiskFlat,
  107.         kZeroOffset,
  108.         kWholeFork,
  109.         kPartClassName        /* This must be the SOM class name */
  110.                             /* for this part.                   */
  111.     }
  112. };
  113.  
  114. //-------------------------------------------------------------------------------------
  115. // NMAP Resources
  116. //-------------------------------------------------------------------------------------
  117.  
  118. // Map a part's class id (module::classname)
  119. // to a part's kind (unique content identifier)
  120. //
  121. resource kODNameMappings (kEditorKindMapId) {
  122.     kODEditorKinds,
  123.     {    /* array Types: 1 elements */
  124.         /* [1] */
  125.         kSamplePartID,
  126.         kODIsAnISOStringList
  127.         {
  128.             {    /* array ClassIDs: 1 elements */
  129.                 /* [1] */
  130.                 kSamplePartKind
  131.             }
  132.         }
  133.     }
  134. };
  135.  
  136. // Map a part's class id (module::classname)
  137. // to a human readable string.
  138. //
  139. resource kODNameMappings (kEditorUserStringMapId) {
  140.     kODEditorUserString,
  141.     {    /* array Types: 1 elements */
  142.         /* [1] */
  143.         kSamplePartID,
  144.         kODIsINTLText
  145.         {
  146.             smRoman,
  147.             langEnglish,
  148.             kSamplePartEditorUserString
  149.         }
  150.     }
  151. };
  152.  
  153. // Map a part's kind (unique content identifier)
  154. // to a generic content category identifier.
  155. //
  156. resource kODNameMappings (kKindCategoryMapId) {
  157.     kODKind,
  158.     {    /* array Types: 1 elements */
  159.         /* [1] */
  160.         kSamplePartKind,
  161.         kODIsAnISOStringList
  162.         {
  163.             {    /* array ClassIDs: 1 elements */
  164.                 /* [1] */
  165.                 kSamplePartCategory
  166.             }
  167.         }
  168.     }
  169. };
  170.  
  171. // Map a part's kind (unique content identifier)
  172. // to a human readable string.
  173. //
  174. resource kODNameMappings (kKindUserStringMapId) {
  175.     kODKindUserString,
  176.     {    /* array Types: 1 elements */
  177.         /* [1] */
  178.         kSamplePartKind,
  179.         kODIsINTLText
  180.         {
  181.             smRoman,
  182.             langEnglish,
  183.             kSamplePartKindUserString
  184.         }
  185.     }
  186. };
  187.  
  188. // Map a part's generic content category identifier
  189. // to a human readable string.
  190. //
  191. resource kODNameMappings (kCategoryUserStringMapId) {
  192.     kODCategoryUserString,
  193.     {    /* array KeyList: 1 elements */
  194.         /* [1] */
  195.         kSamplePartCategory,
  196.         kODIsINTLText {
  197.             smRoman,
  198.             langEnglish,
  199.             kSamplePartCategoryUserString
  200.         }
  201.     }
  202. };
  203.  
  204. // Map a part's kind (unique content identifier)
  205. // to an old style MacOS Type (and/or ScrapType).
  206. //
  207. resource kODNameMappings (kOldMacOSTypeMapId) {
  208.     kODKindOldMacOSType,
  209.     {    /* array KeyList: 1 elements */
  210.         /* [1] */
  211.         kSamplePartKind,
  212.         kODIsMacOSType {
  213.             kSamplePartDocumentOSType
  214.         }
  215.     }
  216. };
  217.  
  218. //-------------------------------------------------------------------------------------
  219. // OLE Interoperability Support
  220. //-------------------------------------------------------------------------------------
  221.  
  222. // This resource allows your editor to be registered with the OLE runtime on the
  223. // Macintosh and subsequently interoperate with OLE clients/servers. Contact Microsoft
  224. // to acqiure a unique class ID.
  225. resource 'olcr' (0, "OLE Class ID")
  226. {
  227.    "{80C11F40-7503-8576-00D01113F11}"; /* your part's CLSID */
  228. };
  229.  
  230. //-------------------------------------------------------------------------------------
  231. // String List Resources
  232. //-------------------------------------------------------------------------------------
  233.  
  234. resource 'STR#' (kMenuStringResID, "Menu Items strings") {
  235.     {    /* array StringArray: 3 elements */
  236.         /* [1] */
  237.         "About SamplePart…",
  238.         /* [2] */
  239.         "PART",
  240.         /* [3] */
  241.         "Sample • Sample"
  242.     }
  243. };
  244.  
  245. resource 'STR#' (kErrorStringResID, "Error strings") {
  246.     {    /* array StringArray: 6 elements */
  247.         /* [1] */
  248.         "“SamplePart” was unable completely initi"
  249.         "alize its internal structures.",
  250.         /* [2] */
  251.         "“SamplePart” was unable to open the docu"
  252.         "ment due to unforseen circumstances.",
  253.         /* [3] */
  254.         "“SamplePart” was unable to open a part w"
  255.         "indow due to unforseen circumstances.",
  256.         /* [4] */
  257.         "“SamplePart” has been asked to remove a "
  258.         "frame that does not belong to it, or an "
  259.         "error occurred while removing the frame "
  260.         "from internal storage.",
  261.         /* [5] */
  262.         "A window that “SamplePart” created has b"
  263.         "een deleted without its knowledge. This "
  264.         "may generate a fatal error in the near f"
  265.         "uture. Please close the document immedia"
  266.         "tely to prevent data loss.",
  267.         /* [6] */
  268.         "“SamplePart” encountered a fatal error w"
  269.         "hile trying to save. Try saving again or"
  270.         " closing the document."
  271.     }
  272. };
  273.  
  274. //-------------------------------------------------------------------------------------
  275. // Finder Related Resources
  276. //-------------------------------------------------------------------------------------
  277.  
  278. // Kind resources affect the text Finder displays in the
  279. // "kind" column and file info dialog. This feature was
  280. // introduced as part of Macintosh Easy Open.
  281. //
  282. resource 'kind' (kBaseResourceID) {
  283.     kSamplePartEditorOSType,
  284.     0, /* region = USA */
  285.     {
  286.         'shlb', "OpenDoc™ editor"
  287.     }
  288. };
  289.     
  290. resource 'kind' (kBaseResourceID+1) {
  291.     kSamplePartViewerOSType,
  292.     0, /* region = USA */
  293.     {
  294.         'shlb', "OpenDoc™ viewer"
  295.     }
  296. };
  297.     
  298. resource 'kind' (kBaseResourceID+2) {
  299.     kODShellSignature,
  300.     0, /* region = USA */
  301.     {
  302.         kSamplePartDocumentOSType, "SamplePartC 1.0 document",
  303.         kSamplePartStationeryOSType, "SamplePartC 1.0 stationery"
  304.     }
  305. };
  306.  
  307. // The -16397 string will be displayed by Finder when a user
  308. // tries to open the editor shared library. The string should
  309. // give the user a little detail about the part's capabilities
  310. // and enough information to install the part in the correct location.
  311. //
  312. resource 'STR ' (-16397, purgeable) {
  313.     "OpenDoc™ Editor\n\nThis part demonstra"
  314.     "tes the functionality of a very basic "
  315.     "part. To use this part, place it in th"
  316.     "e Editors folder on your local system."
  317. };
  318.  
  319. //-------------------------------------------------------------------------------------
  320. // Dialog Resources
  321. //-------------------------------------------------------------------------------------
  322.  
  323. resource 'DLOG' (kAboutBoxID, "SamplePart About Box") {
  324.     {0, 0, 250, 350},
  325.     dBoxProc,
  326.     invisible,
  327.     goAway,
  328.     0x0,
  329.     kAboutBoxID,
  330.     "",
  331.     alertPositionMainScreen
  332. };
  333.  
  334. resource 'DITL' (kAboutBoxID) {
  335.     {    /* array DITLarray: 8 elements */
  336.         /* [1] */
  337.         {222, 270, 242, 338}, Button { enabled, "OK" },
  338.         /* [2] */
  339.         {24, 25, 56, 57}, Picture { disabled, kEditorIconPicture },
  340.         /* [3] */
  341.         {13, 68, 237, 69}, Button { disabled, "" },
  342.         /* [4] */
  343.         {64, 13, 65, 337}, Button { disabled, "" },
  344.         /* [5] */
  345.         {46, 76, 62, 172}, StaticText { disabled, "SamplePart" },
  346.         /* [6] */
  347.         {76, 76, 116, 304}, StaticText { disabled,
  348.             "SamplePart is a sample part editor which"
  349.             " illustrates the functionality of a basi"
  350.             "c part editor." },
  351.         /* [7] */
  352.         {124, 76, 152, 304}, StaticText { disabled,
  353.             "Written by Steve Smith with support from"
  354.             " the OpenDoc™ Engineering team." },
  355.         /* [8] */
  356.         {172, 76, 200, 300}, StaticText { disabled,
  357.             "Copyright© 1994,1995 by Apple Computer, "
  358.             "Inc. All Rights Reserved." }
  359.     }
  360. };
  361.  
  362. resource 'dctb' (kAboutBoxID) {
  363.     /* dialog background fill color */
  364.     {    /* array ColorSpec: 5 elements */
  365.         /* [1] */
  366.         wContentColor, 59127, 59127, 59127,
  367.         /* [2] */
  368.         wFrameColor, 0, 0, 0,
  369.         /* [3] */
  370.         wTextColor, 0, 0, 0,
  371.         /* [4] */
  372.         wHiliteColor, 0, 0, 0,
  373.         /* [5] */
  374.         wTitleBarColor, 65535, 65535, 65535
  375.     }
  376. };
  377.  
  378. data 'ictb' (kAboutBoxID) {
  379.     /* dialog control text styling */
  380.     $"0000 0000 0000 0000 0028 0020 0028 0048"
  381.     $"8007 0070 8007 0084 8007 0098 8007 00AC"
  382.     $"0000 0000 0000 0003 0000 7FFF 7FFF 7FFF"
  383.     $"0001 FFFF FFFF FFFF 0002 0000 0000 0000"
  384.     $"0003 FFFF FFFF FFFF 0000 0000 0000 0003"
  385.     $"0000 7FFF 7FFF 7FFF 0001 FFFF FFFF FFFF"
  386.     $"0002 0000 0000 0000 0003 FFFF FFFF FFFF"
  387.     $"00C0 0100 000E 0000 0000 0000 FFFF FFFF"
  388.     $"FFFF 0000 00C9 0000 0009 0000 0000 0000"
  389.     $"FFFF FFFF FFFF 0000 00D0 0000 0009 0000"
  390.     $"0000 0000 FFFF FFFF FFFF 0000 00D7 0000"
  391.     $"0009 0000 0000 0000 FFFF FFFF FFFF 0000"
  392.     $"0850 616C 6174 696E 6F06 4765 6E65 7661"
  393.     $"0647 656E 6576 6106 4765 6E65 7661"
  394. };
  395.  
  396. resource 'DLOG' (kErrorBoxID, "SamplePart Error Box") {
  397.     {57, 46, 244, 374},
  398.     dBoxProc,
  399.     invisible,
  400.     goAway,
  401.     0x0,
  402.     kErrorBoxID,
  403.     "",
  404.     alertPositionParentWindowScreen
  405. };
  406.  
  407. resource 'DITL' (kErrorBoxID) {
  408.     {    /* array DITLarray: 5 elements */
  409.         /* [1] */
  410.         {153, 256, 173, 314}, Button { enabled, "OK" },
  411.         /* [2] */
  412.         {153, 185, 173, 243}, Button { enabled, "Cancel" },
  413.         /* [3] */
  414.         {11, 70, 124, 317}, StaticText { disabled,
  415.             "<< Use this for errors in the Editor, su"
  416.             "ch as out of memory, unable to acquire s"
  417.             "ome system resource, etc.>> \nUser errors"
  418.             " use a standard alert appearance. See DI"
  419.             "TL 129.>>" },
  420.         /* [4] */
  421.         {11, 19, 43, 51}, Picture { disabled, kEditorIconPicture },
  422.         /* [5] */
  423.         {149, 252, 177, 318}, UserItem { disabled }
  424.     }
  425. };
  426.  
  427. //-------------------------------------------------------------------------------------
  428. // Finder Bundle Information
  429. //-------------------------------------------------------------------------------------
  430.  
  431. resource 'BNDL' (kDocumentBundle, "Document BNDL") {
  432.     kODShellSignature,
  433.     0,
  434.     {    /* array TypeArray: 2 elements */
  435.         /* [1] */
  436.         'FREF',
  437.         {    /* array IDArray: 2 elements */
  438.             /* [1] */
  439.             0, kDocumentFREF,
  440.             /* [2] */
  441.             1, kStationeryFREF
  442.         },
  443.         /* [2] */
  444.         'ICN#',
  445.         {    /* array IDArray: 2 elements */
  446.             /* [1] */
  447.             0, kDocumentIcons,
  448.             /* [2] */
  449.             1, kStationeryIcons
  450.         }
  451.     }
  452. };
  453.  
  454. resource 'BNDL' (kEditorBundle, "Editor BNDL") {
  455.     kSamplePartEditorOSType,
  456.     0,
  457.     {    /* array TypeArray: 2 elements */
  458.         /* [1] */
  459.         'FREF',
  460.         {    /* array IDArray: 1 elements */
  461.             /* [1] */
  462.             0, kEditorFREF
  463.         },
  464.         /* [2] */
  465.         'ICN#',
  466.         {    /* array IDArray: 1 elements */
  467.             /* [1] */
  468.             0, kEditorIcons
  469.         }
  470.     }
  471. };
  472.  
  473. resource 'BNDL' (kViewerBundle, "Viewer BNDL") {
  474.     kSamplePartViewerOSType,
  475.     0,
  476.     {    /* array TypeArray: 2 elements */
  477.         /* [1] */
  478.         'FREF',
  479.         {    /* array IDArray: 1 elements */
  480.             /* [1] */
  481.             0, kViewerFREF
  482.         },
  483.         /* [2] */
  484.         'ICN#',
  485.         {    /* array IDArray: 1 elements */
  486.             /* [1] */
  487.             0, kViewerIcons
  488.         }
  489.     }
  490. };
  491.  
  492. resource 'FREF' (kDocumentFREF) {
  493.     kSamplePartDocumentOSType, 0, ""
  494. };
  495.  
  496. resource 'FREF' (kStationeryFREF) {
  497.     kSamplePartStationeryOSType, 1, ""
  498. };
  499.  
  500. resource 'FREF' (kEditorFREF) {
  501.     'shlb', 0, ""
  502. };
  503.  
  504. resource 'FREF' (kViewerFREF) {
  505.     'shlb', 0, ""
  506. };
  507.  
  508. data kODShellSignature (0, "Owner resource") {
  509.     $"00"
  510. };
  511.  
  512. data kSamplePartViewerOSType (0, "Owner resource") {
  513.     $"00"
  514. };
  515.  
  516. data kSamplePartEditorOSType (0, "Owner resource") {
  517.     $"00"
  518. };
  519.